CFLAGS=-g

SOURCES=atoi.c atol.c bsearch.c calloc.c div.c exit.c free.c getenv.c labs.c \
		ldiv.c malloc.c qsort.c rand.c realloc.c srand.c strtod.c strtol.c \
		strtoul.c system.c abort.c abs.c atexit.c atof.c

PROGRAMS=$(SOURCES:.c=)

all: ${PROGRAMS}

atoi: atoi.c
	${CC} ${CFLAGS} -o $@ $<   
atol: atol.c
	${CC} ${CFLAGS} -o $@ $<
bsearch: bsearch.c
	${CC} ${CFLAGS} -o $@ $<
calloc: calloc.c
	${CC} ${CFLAGS} -o $@ $<
div: div.c
	${CC} ${CFLAGS} -o $@ $<
exit: exit.c
	${CC} ${CFLAGS} -o $@ $<   
free: free.c
	${CC} ${CFLAGS} -o $@ $<
getenv: getenv.c
	${CC} ${CFLAGS} -o $@ $<
labs: labs.c
	${CC} ${CFLAGS} -o $@ $<
ldiv: ldiv.c
	${CC} ${CFLAGS} -o $@ $<
malloc: malloc.c
	${CC} ${CFLAGS} -o $@ $<   
qsort: qsort.c
	${CC} ${CFLAGS} -o $@ $<
rand: rand.c
	${CC} ${CFLAGS} -o $@ $<
realloc: realloc.c
	${CC} ${CFLAGS} -o $@ $<
srand: srand.c
	${CC} ${CFLAGS} -o $@ $<
strtod: strtod.c
	${CC} ${CFLAGS} -o $@ $<   
strtol: strtol.c
	${CC} ${CFLAGS} -o $@ $<
strtoul: strtoul.c
	${CC} ${CFLAGS} -o $@ $<
system: system.c
	${CC} ${CFLAGS} -o $@ $<
abort: abort.c
	${CC} ${CFLAGS} -o $@ $<
abs: abs.c
	${CC} ${CFLAGS} -o $@ $<
atexit: atexit.c
	${CC} ${CFLAGS} -o $@ $<
atof: atof.c
	${CC} ${CFLAGS} -o $@ $< -lm

clean:
	rm -rf ${PROGRAMS}
